import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
    strict: true,
    history: createWebHistory(import.meta.env.VITE_BASE_PATH),
    routes: [
        {
            path: '/',
            name: 'Layout',
            component: () => import(/* webpackChunkName: "home" */ '@/views/layout/index.vue'),
			redirect:'/home',
			children: [
                {
                    path: '/home',
                    name: 'Home',
                    component: () => import(/* webpackChunkName: "home" */ '@/views/home/index.vue')
                },
				{
                    path: '/bookManage',
                    name: 'BookManage',
                    component: () => import(/* webpackChunkName: "home" */ '@/views/bookManage/index.vue')
                },
				{
                    path: '/bookTypeManage',
                    name: 'BookTypeManage',
                    component: () => import(/* webpackChunkName: "home" */ '@/views/bookTypeManage/index.vue')
                },
				{
                    path: '/bookBorrowing',
                    name: 'BookBorrowing',
                    component: () => import(/* webpackChunkName: "home" */ '@/views/bookBorrowing/index.vue')
                }
            ]
        },
	]
})
export const setupRouter = app => {
    app.use(router)
}
export default router